
export class TextUtils {
  static isEmpty(str: any): boolean {
    return !str || str.trim().length === 0;
  }



  static  isPhoneNumber(phone: string): boolean {
    // Define the regular expression pattern for a valid phone number
    const pattern = /^1[3456789]\d{9}$/;

    // Test the input phone number against the pattern
    return pattern.test(phone);
  }



  static isVerificationCodeExceedingLength(code: string, maxLength: number): boolean {
    // Check if the length of the code exceeds the maximum length
    return code.length > maxLength;
  }

}

export  default  function  SplitString(str: string | null | undefined): string {
  if (str === null || str === undefined) {
    return '';
  } else if (str.length <= 5) {
    return str;
  } else {
    return str.substring(0, 5) + '...';
  }
}